package com.itheima.crops.dao;

import com.itheima.crops.pojo.Index;
import com.itheima.crops.pojo.PcropsIndex;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface PcropsIndexMapper  extends Mapper<PcropsIndex> {

    @Select("select * from t_pcrops_index where cid = #{cid} order by id")
    public List<PcropsIndex> findPcropsIndexsByCid(Integer cid);

    @Select("select iid from t_pcrops_index where cid = #{cid} order by id")
    public List<Long> findIidsByCid(Long cid);

    @Delete("delete from t_pcrops_index where cid = #{cid}")
    public void deletePcropsIndexRel(Long cid);

    @Select("select cid from t_pcrops_index where iid = #{iid}")
    public List<Long> findCidsByIid(Long iid);
}
